

#include "Rectangle.h"

Rectangle::Rectangle(int color_) : Polygon(), color(color_) {
	type = string("Rectangle");
}

Rectangle::Rectangle(const Rectangle & other) : Polygon(other), color(other.color){

}

string Rectangle::getType(){
	return type;
}

Rectangle::~Rectangle() {
	std::cout << "Rectangle destructor \n";
}

int Rectangle::getColor(){
	return color;
}

int Rectangle::getNumOfPoints(){
	if (this->getNumOfPoints() < 4) return -1;
	return this->getNumOfPoints();
}

void Rectangle::addPoint(Point* p){
	if (Polygon::getNumOfPoints() == 4){
		cout <<"You can't add any more points to this rectangle\n";
	}else{
		Polygon::addPoint(p);
	}
}
